<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		function Fn(){
			var _this = this;

			this.a = 12;

			//setInterval(this.show, 1000);		//undefined  定时器内部this指向的window，而window没有show方法

			//改错
			setInterval(function (){
				_this.show();
			}, 1000)
		}

		Fn.prototype.show = function (){
			alert(this.a)
		}

		var obj = new Fn();						//必须要new一个对象出来，才能有结果
		/* 或直接new Fn() */

	</script>
</head>
<body>
	
</body>
</html>